package net.es.weathermap.beans;

public class TopologyBean {
    private static final long serialVersionUID = 1L;
    private TopologyBean parent = null;
    private String topoId;

    public TopologyBean() {
    }

    public int compareTo(TopologyBean o) {
        return this.topoId.compareTo(o.getTopoId());
    }


    public boolean equals(Object o) {
        TopologyBean t = (TopologyBean) o;
        if (o == null) {
            return false;
        }
        if (t.getTopoId() == null) {
            if (topoId == null) {
                return true;
            } else {
                return false;
            }
        }
        return (t.getTopoId().equals(topoId));
    }

    public String getFullId() {
        if (parent == null) {
            return topoId;
        }
        return parent.getFullId()+":"+topoId;
    }

    public String toString() {
        return topoId;
    }

    public TopologyBean getParent() {
        return parent;
    }

    public void setParent(TopologyBean parent) {
        this.parent = parent;
    }

    public String getTopoId() {
        return topoId;
    }

    public void setTopoId(String topoId) {
        this.topoId = topoId;
    }


}
